<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('节点管理')" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="workerId-form">
					<div class="select-list">
						<ul>
							<li>
								命名空间：<input type="text" name="namespace"/>
							</li>
							<li>
								主机IP：<input type="text" name="hostIp"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
                
            <div class="btn-group-sm" id="toolbar" role="group">
		        <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="leaf:workerId:add">
                    <i class="fa fa-plus"></i> 新增
                </a>
	        </div>
       		 <div class="col-sm-12 select-table table-striped">
	            <table id="bootstrap-tree-table"></table>
	        </div>
	    </div>
	</div>
	<th:block th:include="include :: footer" />
	<script th:inline="javascript">
		var removeFlag = [[${@permission.hasPermi('leaf:workerId:remove')}]];
		var prefix = ctx + "leaf/workerId"
		$(function() {
		    var options = {
				code: "id",
				uniqueId: "id",
				url: prefix + "/list",
				createUrl: prefix + "/add",
				removeUrl: prefix + "/remove/{id}",
				modalName: "workerId",
				columns: [
					{
						field: 'id',
						title: '编号',
						align: "left"
					},
					{
						field: 'namespace',
						title: '命名空间',
						align: "left"
					},
					{
						field: 'hostIp',
						title: '主机IP',
						align: "left"
					},
		        {
		            field: 'workerId',
		            title: '节点编号',
		            align: "left"
		        },
		        {
		            field: 'createTime',
		            title: '创建时间',
		            align: "left"
		        },
					{
						field: 'updateTime',
						title: '更新时间',
						align: "left"
					},
		        {
		            title: '操作',
		            align: 'left',
		            formatter: function(value, row, index) {
						var actions = [];
						actions.push('<a class="btn btn-info  btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-plus"></i>删除</a> ');
						return actions.join('');

					}
		        }]
		    };
		    $.treeTable.init(options);
		});
	</script>
</body>
</html>